<%@ page contentType="text/html;charset=UTF-8"%>
<%@ page import="java.util.Vector,com.ejoysoft.wlanyz.business.Cityanalysis,com.ejoysoft.common.Constants,com.ejoysoft.common.exception.NoRightException" %>
<%@page import="sun.reflect.generics.tree.IntSignature"%>
<%@page import="com.ejoysoft.common.Format"%>
<%@ page import="java.util.List"%>
<%@ page import="com.ejoysoft.citygraph.*"%>
<%@page import="java.util.Random"%>
<%@page import="java.util.List"%>
<%@page import="java.util.ArrayList"%>
<%@ include file="../include/jsp/head.jsp"%>

<%
	if(!globa.userSession.hasRight("10005"))
      throw new NoRightException("用户不具备操作该功能模块的权限，请与系统管理员联系！");
%>

<%
	Cityanalysis task0 = null;
	Cityanalysis obj = new Cityanalysis(globa);

	//获取所有地市
	String where = "";
	List<String> listcity = obj.returnCity(where);	
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><%=application.getAttribute("APP_TITLE")%></title> 
<link href="../css/main.css" rel="stylesheet" type="text/css" />
<script language="JavaScript" src="../include/date/popc.js"></script>
<script src="../include/js/list.js"></script>
<style>
A {text-decoration: NONE} 
</style>
<script type="text/javascript">
	function clkOn(){
		frm.action="line_hotpot.jsp";
		frm.submit();
	}
	function clkOn2(){
		frm.action="line_ap.jsp";
		frm.submit();
	}
	function clkOn3(){
		frm.action="line_task.jsp";
		frm.submit();
	}
	function clkOn4(){
		frm.action="line_maintainer.jsp";
		frm.submit();
	}
	function clkOn5(){
		frm.action="line_rate.jsp";
		frm.submit();
	}
	function clkOn6(){
		frm.action="list_rate.jsp";
		frm.submit();
	}
	</script>
</head>


<body>
<form name=frm method=post action="list_rate.jsp">
	<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
	 <tr>
	 <td align="center" width="10%"  height="27" background="../images/tab_2.jpg" id="tabLabel1" onclick="clkOn()" style="cursor:hand">地市热点分析</td>
	 <td align="center" width="10%"  background="../images/tab_2.jpg" id="tabLabel2"  onclick="clkOn2()" style="cursor:hand">地市AP分析</td>
	 <td align="center" width="10%" background="../images/tab_2.jpg" id="tabLabel3" onclick="clkOn3()" style="cursor:hand">地市任务分析</td>
	 <td align="center" width="10%"  height="27" background="../images/tab_2.jpg" id="tabLabel4" onclick="clkOn4()" style="cursor:hand">地市人员分析</td>
	 <td align="center" width="10%"  background="../images/tab_2.jpg" id="tabLabel5"  onclick="clkOn5()" style="cursor:hand">测试结果占比</td>
	 <td align="center" width="10%" background="../images/tab_1.jpg" id="tabLabel6" onclick="clkOn6()" style="cursor:hand">列表信息</td>
	 <td background="../images/tab_2.jpg">&nbsp;</td>
	    </tr>
	 </table>
	 <table width="97%" border="0" align="center" cellpadding="0" cellspacing="0">
	  <tr>
	    <td height="30"><img src="../images/ri_list.jpg" width="14" height="14" align="bottom" />&nbsp;<font size=2>您现在所在的位置：</font><font color="#0e7cc9" size=2>地市覆盖分析</font> <font size=2>&gt;列表信息</font></td>
	  </tr>
	</table>
<table width="97%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="4%" class="listtit">地市</td>
    <td width="6%" class="listtit">热点数量</td>
    <td width="8%" class="listtit">已测热点数量</td>
    <td width="10%" class="listtit">已测热点百分比</td>
    <td width="6%" class="listtit">AP数量</td>
    <td width="8%" class="listtit">已测AP数量</td>
    <td width="10%" class="listtit">已测AP百分比</td>
    <td width="6%" class="listtit">任务数量</td>
    <td width="8%" class="listtit">已测任务数量</td>
    <td width="10%" class="listtit">已测任务百分比</td>
    <td width="6%" class="listtit">人员数量</td>
    <td width="8%" class="listtit">已测人员数量</td>
    <td width="10%" class="listtit">已测人员百分比</td>
  </tr>

	<%
	//分别对每个城市进行信息统计
	for(int i=0;i<listcity.size();i++){
		//***********************统计每个城市热点完成测试所占比例*****************************//
		///////////////统计每个城市的热点总数，记为count1///////////////
		where = "where strcity= '"+listcity.get(i)+"'";
		int count1 = obj.returnHpcount(where);		
		//////////////统计每个城市已测试的热点数目,记为count2///////////////
		where = "";
		int count2 = obj.returntestedHpcount(where,listcity.get(i));
		float rate_hotpot = 0;
		System.out.println(listcity.get(i)+"总热点数为："+count1+",已测热点数为:"+count2);
		if(count1!=0){
			rate_hotpot = (float)count2/(float)count1;
		}
		
		//***********************统计每个城市AP完成测试所占比例******************************//
		///////////////统计每个城市的AP总数，记为count1///////////////
		where = "where strcity= '"+listcity.get(i)+"'";
		int count3 = obj.returnApcount(where);		
		//////////////统计每个城市已测试的热点数目,记为count2///////////////
		where = "";
		int count4 = obj.returntestedApcount(where,listcity.get(i));
		System.out.println(listcity.get(i)+"总AP数为："+count3+",已测AP数为:"+count4);	
		float rate_ap = 0;
		if(count3!=0){
			rate_ap = (float)count4/(float)count3;
		}
		
		//***********************统计每个城市任务完成测试所占比例***************************//
		///////////////统计每个城市的下发任务总数，记为count1///////////////
		where = listcity.get(i);
		int count5 = obj.returnTaskcount(where);
		//////////////统计每个城市已测试的热点数目,记为count2///////////////
		where = "";
		int count6 = obj.returntestedTaskcount(where,listcity.get(i));
		System.out.println(listcity.get(i)+"总任务数为："+count5+",已测任务数为:"+count6);
		float rate_task = 0;
		if(count5!=0){
			rate_task = (float)count6/(float)count5;
		}
		
		//***********************统计每个城市人员完成测试所占比例**************************//
		///////////////统计每个城市的人员总数，记为count1///////////////
		where = listcity.get(i);
		int count7 = obj.returnMancount(where);
		//////////////统计每个城市完成测试人员的数目,记为count2///////////////
		where = "";
		int count8 = obj.returntestedMancount(where,listcity.get(i));
		System.out.println(listcity.get(i)+"总测试人员数为："+count7+",已测测试人员数为:"+count8);
		float rate_maintainer = 0;
		if(count7!=0){
			rate_maintainer = (float)count8/(float)count7;
		}	
	 %>

  <tr>
  <td class="listd1" style="border-left:1px solid #dddddd;" width="4%"> <%=listcity.get(i) %></a>&nbsp;</td>
    <td class="listd1" width="6%"><%=count1 %>&nbsp;</td> 
    <td class="listd1" width="8%"><%=count2 %>&nbsp;</td> 
    <td class="listd1" width="10%"><%=rate_hotpot*100 %>%&nbsp;</td>
    <td class="listd1" width="6%"><%=count3 %>&nbsp;</td> 
    <td class="listd1" width="8%"><%=count4 %>&nbsp;</td> 
    <td class="listd1" width="10%"><%=rate_ap*100 %>%&nbsp;</td>
    <td class="listd1" width="6%"><%=count5 %>&nbsp;</td> 
    <td class="listd1" width="8%"><%=count6 %>&nbsp;</td> 
    <td class="listd1" width="10%"><%=rate_task*100 %>%&nbsp;</td>
    <td class="listd1" width="6%"><%=count7 %>&nbsp;</td> 
    <td class="listd1" width="8%"><%=count8 %>&nbsp;</td> 
    <td class="listd1" width="10%"><%=rate_maintainer*100 %>%&nbsp;</td>
  </tr>
  <%} %>
</table>
</form>
</body>
</html>
<%@ include file="../include/jsp/footer.jsp"%>